
// Open MoneySpinner Suite v1
// An open source business management software system written in Java and MySQL
// Recommended IDE is NetBeans IDE 7.0.1
// Support Web Site: http://www.milliscript.com
//
// Copyright (C) 2014, Abiodun Aremu, Ibadan/NIGERIA.
// Open MoneySpinner Suite is distributed under the terms of the Apache License version 2.0
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/*
 * EditEmployee.java
 *
 * Created on Jan 27, 2011, 5:33:29 PM
 */

package openmoneyspinnersuite;

/**
 *
 * @author Abiodun Aremu
 */
import javax.swing.*;
import java.sql.*;
import java.io.*;
import javax.imageio.*;
import java.awt.image.*;
import java.awt.*;
import java.util.*;
import java.text.*;


final class EditEmployee extends javax.swing.JInternalFrame {
    Systems systems=new Systems();
    PreparedStatement statement;
    ResultSet result;
    Thread editEmployeeThread=new Thread();
    Thread editEmployeeTitleThread=new Thread();

    File pictureFile;
    String filePath="";
    Image pictureImage;
    ImageIcon pictureIcon;
    FileInputStream pictureInput;
    FileOutputStream pictureOutput;

    String dbFirstName="";
    String dbMiddleName="";
    String dbLastName="";
    String dbTitle="";
    String dbStatus="";
    String dbAddress="";
    String dbState="";
    String dbCity="";
    String dbCountryCode="";
    String dbCountry="";
    String dbPhoneNo="";
    String dbDepartmentCode="";
    String dbDepartment="";
    String dbDesignationCode="";
    String dbDesignation="";
    String dbZip="";
    String dbSex="";
    String dbAccountNo="";
    String dbBank="";
    String dbBankCode="";
    java.sql.Date dbAppointmentDate;
    String dbAptDay="-- Day --";
    String dbAptMonth="-- Month --";
    String dbAptYear="-- Year --";
    java.sql.Date dbDOB;
    String dbDOBDay="-- Day --";
    String dbDOBMonth="-- Month --";
    String dbDOBYear="-- Year --";
    java.sql.Date dbResignationDate;
    String dbResignationDay="-- Day --";
    String dbResignationMonth="-- Month --";
    String dbResignationYear="-- Year --";
    JFileChooser chooseFile;

    /** Creates new form EditEmployee */
     EditEmployee() {
        initComponents();
        /* Execute submit thread */
        editEmployeeThread=new Thread(new Runnable() {
            public void run() {
                disableControls();
                resetEmployeeID();
                resetCountry();
                resetFields();
            }
        });
        editEmployeeTitleThread=new Thread(new Runnable() {
            public void run() {
                while(editEmployeeThread.isAlive())setProcessingTitle(editEmployeeTitleThread);
                enableControls();
                System.out.println("accountThread stopped runing.");
            }
        });
        editEmployeeThread.start();
        editEmployeeTitleThread.start();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jEmployeePanel = new javax.swing.JPanel();
        jFirstNameTextField = new javax.swing.JTextField();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLastNameTextField = new javax.swing.JTextField();
        jLabel4 = new javax.swing.JLabel();
        jMiddleNameTextField = new javax.swing.JTextField();
        jUpdateButton = new javax.swing.JButton();
        jCityTextField = new javax.swing.JTextField();
        jPhoneTextField = new javax.swing.JTextField();
        jZipTextField = new javax.swing.JTextField();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        jLabel11 = new javax.swing.JLabel();
        jSexComboBox = new javax.swing.JComboBox();
        jBankComboBox = new javax.swing.JComboBox();
        jDepartmentComboBox = new javax.swing.JComboBox();
        jDesignationComboBox = new javax.swing.JComboBox();
        jLabel12 = new javax.swing.JLabel();
        jLabel13 = new javax.swing.JLabel();
        jLabel14 = new javax.swing.JLabel();
        jTitleComboBox = new javax.swing.JComboBox();
        jLabel15 = new javax.swing.JLabel();
        jCountryComboBox = new javax.swing.JComboBox();
        jLabel16 = new javax.swing.JLabel();
        jStateTextField = new javax.swing.JTextField();
        jLabel17 = new javax.swing.JLabel();
        jLabel18 = new javax.swing.JLabel();
        jAddressTextField = new javax.swing.JTextField();
        jPictureButton = new javax.swing.JButton();
        jPanel2 = new javax.swing.JPanel();
        picLabel = new javax.swing.JLabel();
        jLastNameCheckBox = new javax.swing.JCheckBox();
        jAddressCheckBox = new javax.swing.JCheckBox();
        jStateCheckBox = new javax.swing.JCheckBox();
        jPhoneCheckBox = new javax.swing.JCheckBox();
        jDesignationCheckBox = new javax.swing.JCheckBox();
        jDepartmentCheckBox = new javax.swing.JCheckBox();
        jZipCheckBox = new javax.swing.JCheckBox();
        jCityCheckBox = new javax.swing.JCheckBox();
        jCountryCheckBox = new javax.swing.JCheckBox();
        jAccountCheckBox = new javax.swing.JCheckBox();
        jBankCheckBox = new javax.swing.JCheckBox();
        jLabel19 = new javax.swing.JLabel();
        jAccountNoTextField = new javax.swing.JTextField();
        jResignationCheckBox = new javax.swing.JCheckBox();
        jTitleCheckBox = new javax.swing.JCheckBox();
        jEmployeeIDComboBox = new javax.swing.JComboBox();
        jLabel20 = new javax.swing.JLabel();
        cancelButton = new javax.swing.JButton();
        resignationMonthComboBox = new javax.swing.JComboBox();
        resignationDayComboBox = new javax.swing.JComboBox();
        resignationYearComboBox = new javax.swing.JComboBox();
        jPictureCheckBox = new javax.swing.JCheckBox();
        dobMonthComboBox = new javax.swing.JComboBox();
        dobDayComboBox = new javax.swing.JComboBox();
        dobYearComboBox = new javax.swing.JComboBox();
        aptMonthComboBox = new javax.swing.JComboBox();
        aptDayComboBox = new javax.swing.JComboBox();
        aptYearComboBox = new javax.swing.JComboBox();
        jStatusComboBox = new javax.swing.JComboBox();
        jLabel21 = new javax.swing.JLabel();
        jStatusCheckBox = new javax.swing.JCheckBox();

        setClosable(true);
        setResizable(true);
        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(openmoneyspinnersuite.OpenMS_Finance_App.class).getContext().getResourceMap(EditEmployee.class);
        setTitle(resourceMap.getString("Form.title")); // NOI18N
        setFrameIcon(resourceMap.getIcon("Form.frameIcon")); // NOI18N
        setName("Form"); // NOI18N
        setVisible(true);

        jEmployeePanel.setName("jEmployeePanel"); // NOI18N

        jFirstNameTextField.setEditable(false);
        jFirstNameTextField.setName("jFirstNameTextField"); // NOI18N
        jFirstNameTextField.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jFirstNameTextFieldActionPerformed(evt);
            }
        });
        jFirstNameTextField.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                jFirstNameTextFieldKeyTyped(evt);
            }
        });

        jLabel2.setText(resourceMap.getString("jLabel2.text")); // NOI18N
        jLabel2.setName("jLabel2"); // NOI18N

        jLabel3.setText(resourceMap.getString("jLabel3.text")); // NOI18N
        jLabel3.setName("jLabel3"); // NOI18N

        jLastNameTextField.setEditable(false);
        jLastNameTextField.setName("jLastNameTextField"); // NOI18N
        jLastNameTextField.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jLastNameTextFieldActionPerformed(evt);
            }
        });
        jLastNameTextField.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                jLastNameTextFieldKeyTyped(evt);
            }
        });

        jLabel4.setText(resourceMap.getString("jLabel4.text")); // NOI18N
        jLabel4.setName("jLabel4"); // NOI18N

        jMiddleNameTextField.setEditable(false);
        jMiddleNameTextField.setName("jMiddleNameTextField"); // NOI18N
        jMiddleNameTextField.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMiddleNameTextFieldActionPerformed(evt);
            }
        });
        jMiddleNameTextField.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                jMiddleNameTextFieldKeyTyped(evt);
            }
        });

        jUpdateButton.setFont(resourceMap.getFont("jUpdateButton.font")); // NOI18N
        jUpdateButton.setIcon(resourceMap.getIcon("jUpdateButton.icon")); // NOI18N
        jUpdateButton.setText(resourceMap.getString("jUpdateButton.text")); // NOI18N
        jUpdateButton.setName("jUpdateButton"); // NOI18N
        jUpdateButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jUpdateButtonActionPerformed(evt);
            }
        });

        jCityTextField.setEditable(false);
        jCityTextField.setName("jCityTextField"); // NOI18N
        jCityTextField.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jCityTextFieldActionPerformed(evt);
            }
        });
        jCityTextField.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                jCityTextFieldKeyTyped(evt);
            }
        });

        jPhoneTextField.setEditable(false);
        jPhoneTextField.setName("jPhoneTextField"); // NOI18N
        jPhoneTextField.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jPhoneTextFieldActionPerformed(evt);
            }
        });
        jPhoneTextField.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                jPhoneTextFieldKeyTyped(evt);
            }
        });

        jZipTextField.setEditable(false);
        jZipTextField.setName("jZipTextField"); // NOI18N
        jZipTextField.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jZipTextFieldActionPerformed(evt);
            }
        });
        jZipTextField.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                jZipTextFieldKeyTyped(evt);
            }
        });

        jLabel5.setText(resourceMap.getString("jLabel5.text")); // NOI18N
        jLabel5.setName("jLabel5"); // NOI18N

        jLabel6.setText(resourceMap.getString("jLabel6.text")); // NOI18N
        jLabel6.setName("jLabel6"); // NOI18N

        jLabel7.setText(resourceMap.getString("jLabel7.text")); // NOI18N
        jLabel7.setName("jLabel7"); // NOI18N

        jLabel8.setText(resourceMap.getString("jLabel8.text")); // NOI18N
        jLabel8.setName("jLabel8"); // NOI18N

        jLabel9.setText(resourceMap.getString("jLabel9.text")); // NOI18N
        jLabel9.setName("jLabel9"); // NOI18N

        jLabel10.setText(resourceMap.getString("jLabel10.text")); // NOI18N
        jLabel10.setName("jLabel10"); // NOI18N

        jLabel11.setText(resourceMap.getString("jLabel11.text")); // NOI18N
        jLabel11.setName("jLabel11"); // NOI18N

        jSexComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "-- Select --", "M", "F" }));
        jSexComboBox.setEnabled(false);
        jSexComboBox.setName("jSexComboBox"); // NOI18N

        jBankComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "-- Select --" }));
        jBankComboBox.setEnabled(false);
        jBankComboBox.setName("jBankComboBox"); // NOI18N
        jBankComboBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBankComboBoxActionPerformed(evt);
            }
        });

        jDepartmentComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "-- Select --" }));
        jDepartmentComboBox.setEnabled(false);
        jDepartmentComboBox.setName("jDepartmentComboBox"); // NOI18N
        jDepartmentComboBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jDepartmentComboBoxActionPerformed(evt);
            }
        });

        jDesignationComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "-- Select --" }));
        jDesignationComboBox.setEnabled(false);
        jDesignationComboBox.setName("jDesignationComboBox"); // NOI18N
        jDesignationComboBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jDesignationComboBoxActionPerformed(evt);
            }
        });

        jLabel12.setText(resourceMap.getString("jLabel12.text")); // NOI18N
        jLabel12.setName("jLabel12"); // NOI18N

        jLabel13.setText(resourceMap.getString("jLabel13.text")); // NOI18N
        jLabel13.setName("jLabel13"); // NOI18N

        jLabel14.setText(resourceMap.getString("jLabel14.text")); // NOI18N
        jLabel14.setName("jLabel14"); // NOI18N

        jTitleComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "-- Select --", "Mr", "Mrs", "Miss" }));
        jTitleComboBox.setEnabled(false);
        jTitleComboBox.setName("jTitleComboBox"); // NOI18N

        jLabel15.setText(resourceMap.getString("jLabel15.text")); // NOI18N
        jLabel15.setName("jLabel15"); // NOI18N

        jCountryComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "-- Select --" }));
        jCountryComboBox.setEnabled(false);
        jCountryComboBox.setName("jCountryComboBox"); // NOI18N

        jLabel16.setText(resourceMap.getString("jLabel16.text")); // NOI18N
        jLabel16.setName("jLabel16"); // NOI18N

        jStateTextField.setEditable(false);
        jStateTextField.setName("jStateTextField"); // NOI18N
        jStateTextField.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jStateTextFieldActionPerformed(evt);
            }
        });
        jStateTextField.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                jStateTextFieldKeyTyped(evt);
            }
        });

        jLabel17.setText(resourceMap.getString("jLabel17.text")); // NOI18N
        jLabel17.setName("jLabel17"); // NOI18N

        jLabel18.setText(resourceMap.getString("jLabel18.text")); // NOI18N
        jLabel18.setName("jLabel18"); // NOI18N

        jAddressTextField.setEditable(false);
        jAddressTextField.setName("jAddressTextField"); // NOI18N
        jAddressTextField.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jAddressTextFieldActionPerformed(evt);
            }
        });
        jAddressTextField.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                jAddressTextFieldKeyTyped(evt);
            }
        });

        jPictureButton.setText(resourceMap.getString("jPictureButton.text")); // NOI18N
        jPictureButton.setEnabled(false);
        jPictureButton.setName("jPictureButton"); // NOI18N
        jPictureButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jPictureButtonActionPerformed(evt);
            }
        });

        jPanel2.setBackground(resourceMap.getColor("jPanel2.background")); // NOI18N
        jPanel2.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED));
        jPanel2.setName("jPanel2"); // NOI18N
        jPanel2.setPreferredSize(new java.awt.Dimension(140, 160));

        picLabel.setIcon(resourceMap.getIcon("picLabel.icon")); // NOI18N
        picLabel.setText(resourceMap.getString("picLabel.text")); // NOI18N
        picLabel.setName("picLabel"); // NOI18N

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 136, Short.MAX_VALUE)
            .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel2Layout.createSequentialGroup()
                    .addGap(0, 0, Short.MAX_VALUE)
                    .addComponent(picLabel)
                    .addGap(0, 0, Short.MAX_VALUE)))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 159, Short.MAX_VALUE)
            .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel2Layout.createSequentialGroup()
                    .addGap(0, 0, Short.MAX_VALUE)
                    .addComponent(picLabel)
                    .addGap(0, 0, Short.MAX_VALUE)))
        );

        jLastNameCheckBox.setText(resourceMap.getString("jLastNameCheckBox.text")); // NOI18N
        jLastNameCheckBox.setName("jLastNameCheckBox"); // NOI18N
        jLastNameCheckBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jLastNameCheckBoxActionPerformed(evt);
            }
        });

        jAddressCheckBox.setText(resourceMap.getString("jAddressCheckBox.text")); // NOI18N
        jAddressCheckBox.setName("jAddressCheckBox"); // NOI18N
        jAddressCheckBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jAddressCheckBoxActionPerformed(evt);
            }
        });

        jStateCheckBox.setText(resourceMap.getString("jStateCheckBox4.text")); // NOI18N
        jStateCheckBox.setName("jStateCheckBox4"); // NOI18N
        jStateCheckBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jStateCheckBoxActionPerformed(evt);
            }
        });

        jPhoneCheckBox.setText(resourceMap.getString("jPhoneCheckBox.text")); // NOI18N
        jPhoneCheckBox.setName("jPhoneCheckBox"); // NOI18N
        jPhoneCheckBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jPhoneCheckBoxActionPerformed(evt);
            }
        });

        jDesignationCheckBox.setText(resourceMap.getString("jDesignationCheckBox.text")); // NOI18N
        jDesignationCheckBox.setName("jDesignationCheckBox"); // NOI18N
        jDesignationCheckBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jDesignationCheckBoxActionPerformed(evt);
            }
        });

        jDepartmentCheckBox.setText(resourceMap.getString("jDepartmentCheckBox.text")); // NOI18N
        jDepartmentCheckBox.setName("jDepartmentCheckBox"); // NOI18N
        jDepartmentCheckBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jDepartmentCheckBoxActionPerformed(evt);
            }
        });

        jZipCheckBox.setName("jZipCheckBox"); // NOI18N
        jZipCheckBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jZipCheckBoxActionPerformed(evt);
            }
        });

        jCityCheckBox.setName("jCityCheckBox"); // NOI18N
        jCityCheckBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jCityCheckBoxActionPerformed(evt);
            }
        });

        jCountryCheckBox.setName("jCountryCheckBox"); // NOI18N
        jCountryCheckBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jCountryCheckBoxActionPerformed(evt);
            }
        });

        jAccountCheckBox.setName("jAccountCheckBox"); // NOI18N
        jAccountCheckBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jAccountCheckBoxActionPerformed(evt);
            }
        });

        jBankCheckBox.setName("jBankCheckBox"); // NOI18N
        jBankCheckBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBankCheckBoxActionPerformed(evt);
            }
        });

        jLabel19.setText(resourceMap.getString("jLabel19.text")); // NOI18N
        jLabel19.setName("jLabel19"); // NOI18N

        jAccountNoTextField.setEditable(false);
        jAccountNoTextField.setName("jAccountNoTextField"); // NOI18N
        jAccountNoTextField.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jAccountNoTextFieldActionPerformed(evt);
            }
        });
        jAccountNoTextField.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                jAccountNoTextFieldKeyTyped(evt);
            }
        });

        jResignationCheckBox.setName("jResignationCheckBox"); // NOI18N
        jResignationCheckBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jResignationCheckBoxActionPerformed(evt);
            }
        });

        jTitleCheckBox.setName("jTitleCheckBox"); // NOI18N
        jTitleCheckBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTitleCheckBoxActionPerformed(evt);
            }
        });

        jEmployeeIDComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "-- Select --", "Mr", "Mrs", "Miss" }));
        jEmployeeIDComboBox.setName("jEmployeeIDComboBox"); // NOI18N
        jEmployeeIDComboBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jEmployeeIDComboBoxActionPerformed(evt);
            }
        });

        jLabel20.setText(resourceMap.getString("jLabel20.text")); // NOI18N
        jLabel20.setName("jLabel20"); // NOI18N

        cancelButton.setFont(resourceMap.getFont("cancelButton.font")); // NOI18N
        cancelButton.setIcon(resourceMap.getIcon("cancelButton.icon")); // NOI18N
        cancelButton.setText(resourceMap.getString("cancelButton.text")); // NOI18N
        cancelButton.setName("cancelButton"); // NOI18N
        cancelButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cancelButtonActionPerformed(evt);
            }
        });

        resignationMonthComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "-- Month --" }));
        resignationMonthComboBox.setEnabled(false);
        resignationMonthComboBox.setName("resignationMonthComboBox"); // NOI18N
        resignationMonthComboBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                resignationMonthComboBoxActionPerformed(evt);
            }
        });

        resignationDayComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "-- Day --" }));
        resignationDayComboBox.setEnabled(false);
        resignationDayComboBox.setName("resignationDayComboBox"); // NOI18N

        resignationYearComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "-- Year --" }));
        resignationYearComboBox.setEnabled(false);
        resignationYearComboBox.setName("resignationYearComboBox"); // NOI18N

        jPictureCheckBox.setText(resourceMap.getString("jPictureCheckBox.text")); // NOI18N
        jPictureCheckBox.setName("jPictureCheckBox"); // NOI18N
        jPictureCheckBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jPictureCheckBoxActionPerformed(evt);
            }
        });

        dobMonthComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "-- Month --" }));
        dobMonthComboBox.setEnabled(false);
        dobMonthComboBox.setName("dobMonthComboBox"); // NOI18N
        dobMonthComboBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                dobMonthComboBoxActionPerformed(evt);
            }
        });

        dobDayComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "-- Day --" }));
        dobDayComboBox.setEnabled(false);
        dobDayComboBox.setName("dobDayComboBox"); // NOI18N

        dobYearComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "-- Year --" }));
        dobYearComboBox.setEnabled(false);
        dobYearComboBox.setName("dobYearComboBox"); // NOI18N

        aptMonthComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "-- Month --" }));
        aptMonthComboBox.setEnabled(false);
        aptMonthComboBox.setName("aptMonthComboBox"); // NOI18N
        aptMonthComboBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                aptMonthComboBoxActionPerformed(evt);
            }
        });

        aptDayComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "-- Day --" }));
        aptDayComboBox.setEnabled(false);
        aptDayComboBox.setName("aptDayComboBox"); // NOI18N

        aptYearComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "-- Year --" }));
        aptYearComboBox.setEnabled(false);
        aptYearComboBox.setName("aptYearComboBox"); // NOI18N

        jStatusComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "-- Select --", "Single", "Married", "Divorced" }));
        jStatusComboBox.setEnabled(false);
        jStatusComboBox.setName("jStatusComboBox"); // NOI18N

        jLabel21.setText(resourceMap.getString("jLabel21.text")); // NOI18N
        jLabel21.setName("jLabel21"); // NOI18N

        jStatusCheckBox.setName("jStatusCheckBox"); // NOI18N
        jStatusCheckBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jStatusCheckBoxActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jEmployeePanelLayout = new javax.swing.GroupLayout(jEmployeePanel);
        jEmployeePanel.setLayout(jEmployeePanelLayout);
        jEmployeePanelLayout.setHorizontalGroup(
            jEmployeePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jEmployeePanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jEmployeePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jEmployeePanelLayout.createSequentialGroup()
                        .addGroup(jEmployeePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jEmployeePanelLayout.createSequentialGroup()
                                .addGroup(jEmployeePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel14)
                                    .addComponent(jLabel8)
                                    .addComponent(jLabel9)
                                    .addComponent(jLabel11)
                                    .addComponent(jLabel15)
                                    .addComponent(jLabel20))
                                .addGap(18, 18, 18))
                            .addGroup(jEmployeePanelLayout.createSequentialGroup()
                                .addComponent(jLabel19)
                                .addGap(23, 23, 23)))
                        .addGroup(jEmployeePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jDesignationComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(jEmployeePanelLayout.createSequentialGroup()
                                .addGap(4, 4, 4)
                                .addGroup(jEmployeePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(jEmployeeIDComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jStatusComboBox, 0, 118, Short.MAX_VALUE)
                                    .addComponent(jTitleComboBox, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                            .addGroup(jEmployeePanelLayout.createSequentialGroup()
                                .addComponent(resignationMonthComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(resignationDayComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(resignationYearComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jEmployeePanelLayout.createSequentialGroup()
                                .addComponent(dobMonthComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(dobDayComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(dobYearComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jEmployeePanelLayout.createSequentialGroup()
                                .addComponent(aptMonthComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(aptDayComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(aptYearComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(jDepartmentComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jEmployeePanelLayout.createSequentialGroup()
                        .addComponent(jLabel12)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 63, Short.MAX_VALUE)
                        .addComponent(jPhoneTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 220, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jEmployeePanelLayout.createSequentialGroup()
                        .addGroup(jEmployeePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel17)
                            .addComponent(jLabel18)
                            .addComponent(jLabel10)
                            .addComponent(jLabel2)
                            .addComponent(jLabel4)
                            .addComponent(jLabel21))
                        .addGap(49, 49, 49)
                        .addGroup(jEmployeePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jFirstNameTextField, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 220, Short.MAX_VALUE)
                            .addComponent(jAddressTextField, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 220, Short.MAX_VALUE)
                            .addComponent(jStateTextField, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 220, Short.MAX_VALUE)
                            .addComponent(jLastNameTextField, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 220, Short.MAX_VALUE)
                            .addComponent(jMiddleNameTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 220, Short.MAX_VALUE))))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jEmployeePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jEmployeePanelLayout.createSequentialGroup()
                        .addGroup(jEmployeePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jDepartmentCheckBox)
                            .addComponent(jDesignationCheckBox)
                            .addComponent(jTitleCheckBox)
                            .addComponent(jPhoneCheckBox)
                            .addComponent(jStateCheckBox)
                            .addComponent(jAddressCheckBox)
                            .addComponent(jLastNameCheckBox)
                            .addComponent(jStatusCheckBox))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jEmployeePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addGroup(jEmployeePanelLayout.createSequentialGroup()
                                .addGap(66, 66, 66)
                                .addGroup(jEmployeePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addGroup(jEmployeePanelLayout.createSequentialGroup()
                                        .addGroup(jEmployeePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(jLabel16)
                                            .addComponent(jLabel13)
                                            .addComponent(jLabel5)
                                            .addComponent(jLabel7)
                                            .addComponent(jLabel6)
                                            .addComponent(jLabel3))
                                        .addGap(13, 13, 13)
                                        .addGroup(jEmployeePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jEmployeePanelLayout.createSequentialGroup()
                                                .addGroup(jEmployeePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addComponent(jCountryComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(jSexComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(jBankComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addGroup(jEmployeePanelLayout.createSequentialGroup()
                                                        .addGap(8, 8, 8)
                                                        .addComponent(jUpdateButton)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                        .addComponent(cancelButton))
                                                    .addComponent(jAccountNoTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 190, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(jZipTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 190, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addGroup(jEmployeePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGroup(jEmployeePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                                        .addComponent(jAccountCheckBox)
                                                        .addComponent(jBankCheckBox))
                                                    .addComponent(jZipCheckBox)))
                                            .addComponent(jCityTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 191, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                    .addComponent(jCityCheckBox)
                                    .addComponent(jCountryCheckBox))
                                .addGap(36, 36, 36))
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jEmployeePanelLayout.createSequentialGroup()
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 146, Short.MAX_VALUE)
                                .addGroup(jEmployeePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addGroup(jEmployeePanelLayout.createSequentialGroup()
                                        .addComponent(jPictureButton)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addComponent(jPictureCheckBox))
                                    .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGap(51, 51, 51))))
                    .addComponent(jResignationCheckBox))
                .addContainerGap())
        );
        jEmployeePanelLayout.setVerticalGroup(
            jEmployeePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jEmployeePanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jEmployeePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jEmployeePanelLayout.createSequentialGroup()
                        .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, 160, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jEmployeePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jPictureButton)
                            .addComponent(jPictureCheckBox))
                        .addGap(24, 24, 24)
                        .addGroup(jEmployeePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(jEmployeePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jZipTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jLabel6))
                            .addComponent(jZipCheckBox))
                        .addGap(18, 18, 18)
                        .addGroup(jEmployeePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(jEmployeePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jCityTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jLabel7))
                            .addComponent(jCityCheckBox))
                        .addGap(16, 16, 16)
                        .addGroup(jEmployeePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(jEmployeePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jCountryComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jLabel5))
                            .addComponent(jCountryCheckBox))
                        .addGap(14, 14, 14)
                        .addGroup(jEmployeePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jSexComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel16))
                        .addGap(19, 19, 19)
                        .addGroup(jEmployeePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jEmployeePanelLayout.createSequentialGroup()
                                .addGroup(jEmployeePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jLabel13)
                                    .addComponent(jAccountNoTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGap(19, 19, 19)
                                .addGroup(jEmployeePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jBankComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel3)))
                            .addGroup(jEmployeePanelLayout.createSequentialGroup()
                                .addComponent(jAccountCheckBox)
                                .addGap(18, 18, 18)
                                .addComponent(jBankCheckBox)))
                        .addGap(57, 57, 57)
                        .addGroup(jEmployeePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(cancelButton, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jUpdateButton, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(jEmployeePanelLayout.createSequentialGroup()
                        .addGroup(jEmployeePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jEmployeeIDComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel15))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jEmployeePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jEmployeePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jTitleComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jLabel20))
                            .addComponent(jTitleCheckBox))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jEmployeePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jStatusCheckBox)
                            .addGroup(jEmployeePanelLayout.createSequentialGroup()
                                .addGap(6, 6, 6)
                                .addComponent(jLabel21))
                            .addComponent(jStatusComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(18, 18, 18)
                        .addGroup(jEmployeePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(jEmployeePanelLayout.createSequentialGroup()
                                .addGroup(jEmployeePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jFirstNameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel4))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addGroup(jEmployeePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jMiddleNameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel2))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addGroup(jEmployeePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jLastNameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel10)))
                            .addComponent(jLastNameCheckBox))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jEmployeePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jEmployeePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jAddressTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jLabel18))
                            .addComponent(jAddressCheckBox))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jEmployeePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(jEmployeePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jStateTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jLabel17))
                            .addComponent(jStateCheckBox))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jEmployeePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jEmployeePanelLayout.createSequentialGroup()
                                .addGroup(jEmployeePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jLabel12)
                                    .addComponent(jPhoneTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addGroup(jEmployeePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jLabel11)
                                    .addComponent(dobMonthComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(dobYearComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(dobDayComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addComponent(jPhoneCheckBox))
                        .addGap(18, 18, 18)
                        .addGroup(jEmployeePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel8)
                            .addComponent(jDepartmentCheckBox)
                            .addComponent(jDepartmentComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(18, 18, 18)
                        .addGroup(jEmployeePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel9)
                            .addComponent(jDesignationComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jDesignationCheckBox))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jEmployeePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel14)
                            .addComponent(aptMonthComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(aptYearComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(aptDayComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(19, 19, 19)
                        .addGroup(jEmployeePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jResignationCheckBox)
                            .addGroup(jEmployeePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jLabel19)
                                .addComponent(resignationMonthComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(resignationYearComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(resignationDayComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))))
                .addContainerGap())
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jEmployeePanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jEmployeePanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jFirstNameTextFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jFirstNameTextFieldActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_jFirstNameTextFieldActionPerformed

    private void jLastNameTextFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jLastNameTextFieldActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_jLastNameTextFieldActionPerformed

    private void jMiddleNameTextFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMiddleNameTextFieldActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_jMiddleNameTextFieldActionPerformed

    private void jCityTextFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCityTextFieldActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_jCityTextFieldActionPerformed

    private void jPhoneTextFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jPhoneTextFieldActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_jPhoneTextFieldActionPerformed

    private void jZipTextFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jZipTextFieldActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_jZipTextFieldActionPerformed

    private void jStateTextFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jStateTextFieldActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_jStateTextFieldActionPerformed

    private void jAddressTextFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jAddressTextFieldActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_jAddressTextFieldActionPerformed

    private void jAccountNoTextFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jAccountNoTextFieldActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jAccountNoTextFieldActionPerformed

    private void jTitleCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTitleCheckBoxActionPerformed
        // TODO add your handling code here:
        if(jTitleCheckBox.isSelected())            
        {
            jTitleComboBox.setEnabled(true);
        }
        else
        {
            jTitleComboBox.setEnabled(false);
            if(dbTitle.isEmpty()){
            jTitleComboBox.setSelectedItem(""); }
            else{
            jTitleComboBox.setSelectedItem(dbTitle);
            }
        
        }
    }//GEN-LAST:event_jTitleCheckBoxActionPerformed

    private void jLastNameCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jLastNameCheckBoxActionPerformed
        // TODO add your handling code here:
        if(jLastNameCheckBox.isSelected())
        {
            jLastNameTextField.setEnabled(true);
            jLastNameTextField.setEditable(true);
        }
        else
        {
            jLastNameTextField.setEnabled(false);
            jLastNameTextField.setEditable(false);
            jLastNameTextField.setText(dbLastName);
        }
    }//GEN-LAST:event_jLastNameCheckBoxActionPerformed

    private void jAddressCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jAddressCheckBoxActionPerformed
        // TODO add your handling code here:
        if(jAddressCheckBox.isSelected())
        {
            jAddressTextField.setEnabled(true);
            jAddressTextField.setEditable(true);
        }
        else
        {
            jAddressTextField.setEnabled(false);
            jAddressTextField.setEditable(false);
            jAddressTextField.setText(dbAddress);
        }
    }//GEN-LAST:event_jAddressCheckBoxActionPerformed

    private void jStateCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jStateCheckBoxActionPerformed
        // TODO add your handling code here:
        if(jStateCheckBox.isSelected())
        {
            jStateTextField.setEnabled(true);
            jStateTextField.setEditable(true);
        }
        else
        {
            jStateTextField.setEnabled(false);
            jStateTextField.setEditable(false);
            jStateTextField.setText(dbState);
        }
    }//GEN-LAST:event_jStateCheckBoxActionPerformed

    private void jPhoneCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jPhoneCheckBoxActionPerformed
        // TODO add your handling code here:
        if(jPhoneCheckBox.isSelected())
        {
            jPhoneTextField.setEnabled(true);
            jPhoneTextField.setEditable(true);
        }
        else
        {
            jPhoneTextField.setEnabled(false);
            jPhoneTextField.setEditable(false);
            jPhoneTextField.setText(dbPhoneNo);
        }
    }//GEN-LAST:event_jPhoneCheckBoxActionPerformed

    private void jDepartmentCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jDepartmentCheckBoxActionPerformed
        // TODO add your handling code here:
        if(jDepartmentCheckBox.isSelected())
        {
            jDepartmentComboBox.setEnabled(true);
        }
        else
        {
            jDepartmentComboBox.setEnabled(false);
            if(dbDepartment.isEmpty())
            {resetDepartment();}
            else{
            jDepartmentComboBox.setSelectedItem(dbDepartment);}
        }
    }//GEN-LAST:event_jDepartmentCheckBoxActionPerformed

    private void jDesignationCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jDesignationCheckBoxActionPerformed
        // TODO add your handling code here:
        if(jDesignationCheckBox.isSelected())
        {
            jDesignationComboBox.setEnabled(true);
        }
        else
        {
            jDesignationComboBox.setEnabled(false);
            if(dbDesignation.isEmpty())
            {resetDesignation();}
            else{
            jDesignationComboBox.setSelectedItem(dbDesignation);}
        }
    }//GEN-LAST:event_jDesignationCheckBoxActionPerformed

    private void jZipCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jZipCheckBoxActionPerformed
        // TODO add your handling code here:
        if(jZipCheckBox.isSelected())
        {
            jZipTextField.setEnabled(true);
            jZipTextField.setEditable(true);
        }
        else
        {
            jZipTextField.setEnabled(false);
            jZipTextField.setEditable(false);
            jZipTextField.setText(dbZip);
        }
    }//GEN-LAST:event_jZipCheckBoxActionPerformed

    private void jCityCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCityCheckBoxActionPerformed
        // TODO add your handling code here:
        if(jCityCheckBox.isSelected())
        {
            jCityTextField.setEnabled(true);
            jCityTextField.setEditable(true);
        }
        else
        {
            jCityTextField.setEnabled(false);
            jCityTextField.setEditable(false);
            jCityTextField.setText(dbCity);
        }
    }//GEN-LAST:event_jCityCheckBoxActionPerformed

    private void jCountryCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCountryCheckBoxActionPerformed
        // TODO add your handling code here:
        if(jCountryCheckBox.isSelected())
        {
            jCountryComboBox.setEnabled(true);
        }
        else
        {
            jCountryComboBox.setEnabled(false);
            if(dbCountry.isEmpty()){
                resetCountry();
            }
            else{
            jCountryComboBox.setSelectedItem(dbCountry);
            }
        }
    }//GEN-LAST:event_jCountryCheckBoxActionPerformed

    private void jAccountCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jAccountCheckBoxActionPerformed
        // TODO add your handling code here:
        if(jAccountCheckBox.isSelected())
        {
            jAccountNoTextField.setEnabled(true);
            jAccountNoTextField.setEditable(true);
        }
        else
        {
            jAccountNoTextField.setEnabled(false);
            jAccountNoTextField.setEditable(false);
            jAccountNoTextField.setText(dbAccountNo);
        }
    }//GEN-LAST:event_jAccountCheckBoxActionPerformed

    private void jBankCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBankCheckBoxActionPerformed
        // TODO add your handling code here:
        if(jBankCheckBox.isSelected())
        {
            jBankComboBox.setEnabled(true);
        }
        else
        {
            jBankComboBox.setEnabled(false);
            if(dbBank.isEmpty())
            {resetBank();}
            else{
            jBankComboBox.setSelectedItem(dbBank);
            }
        }
    }//GEN-LAST:event_jBankCheckBoxActionPerformed

    private void jResignationCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jResignationCheckBoxActionPerformed
        // TODO add your handling code here:
        if(jResignationCheckBox.isSelected())
        {
            if(dbResignationMonth.isEmpty()==true&&dbResignationDay.isEmpty()==true&&dbResignationYear.isEmpty()==true)
            {
                JOptionPane.showMessageDialog(JOptionPane.getRootFrame(),"  INVALID OPERATION! \n RESIGNATION DATE AVAILABLE.","ERROR !",JOptionPane.ERROR_MESSAGE);
                return;
            }
            else
            {
                resignationMonthComboBox.setEnabled(true);
                resignationDayComboBox.setEnabled(true);
                resignationYearComboBox.setEnabled(true);
            }
        }
        else
        {
            resignationMonthComboBox.setEnabled(false);
            resignationDayComboBox.setEnabled(false);
            resignationYearComboBox.setEnabled(false);
            if(dbResignationMonth.isEmpty()||dbResignationDay.isEmpty()||dbResignationYear.isEmpty())
            {
            resetRsgMonth();
            resetRsgDay("");
            resetRsgYear();}
            else{
            resignationMonthComboBox.setSelectedItem(dbResignationMonth);
            resignationDayComboBox.setSelectedItem(dbResignationDay);
            resignationYearComboBox.setSelectedItem(dbResignationYear);
            }
        }
    }//GEN-LAST:event_jResignationCheckBoxActionPerformed

    private void jUpdateButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jUpdateButtonActionPerformed
        // TODO add your handling code here:
        if(jEmployeeIDComboBox.getSelectedItem().equals("-- Select --"))
        {
            JOptionPane.showMessageDialog(JOptionPane.getRootFrame(),"Please Select Employee ID ","ERROR !",JOptionPane.ERROR_MESSAGE);
            return;
        }
        
        if(isCheckBoxesFalse()==false)
        {
            JOptionPane.showMessageDialog(JOptionPane.getRootFrame()," No Data Has Been Edited ","ERROR !",JOptionPane.ERROR_MESSAGE);
            return;
        }
        
                
        String value=jPhoneTextField.getText().trim();
        String value2=jAccountNoTextField.getText().trim();

        int x=value.length();
        int xx=value2.length();

        int y=0;
        int yy=0;

        char[] ch=value.toCharArray();
        char[] ch2=value2.toCharArray();

        if(jTitleComboBox.getSelectedItem().equals("-- Select --"))
        {
            JOptionPane.showMessageDialog(JOptionPane.getRootFrame(),"Please Select Employee's Title ","ERROR !",JOptionPane.ERROR_MESSAGE);
            return;
        }
        if(jStatusComboBox.getSelectedItem().equals("-- Select --"))
        {
            JOptionPane.showMessageDialog(JOptionPane.getRootFrame(),"Please Select Employee's Status ","ERROR !",JOptionPane.ERROR_MESSAGE);
            return;
        }
        if(jFirstNameTextField.getText().trim().isEmpty())
        {
            JOptionPane.showMessageDialog(JOptionPane.getRootFrame(),"Please Enter Employee's First Name ","ERROR !",JOptionPane.ERROR_MESSAGE);
            return;
        }
        if(jLastNameTextField.getText().trim().isEmpty())
        {
            JOptionPane.showMessageDialog(JOptionPane.getRootFrame(),"Please Enter Employee's Last Name ","ERROR !",JOptionPane.ERROR_MESSAGE);
            return;
        }

        if(jAddressTextField.getText().trim().isEmpty())
        {
            JOptionPane.showMessageDialog(JOptionPane.getRootFrame(),"Please Enter Employee's Address ","ERROR !",JOptionPane.ERROR_MESSAGE);
            return;
        }
        if(jStateTextField.getText().trim().isEmpty())
        {
            JOptionPane.showMessageDialog(JOptionPane.getRootFrame(),"Please Enter Employee's State ","ERROR !",JOptionPane.ERROR_MESSAGE);
            return;
        }
        if(jPhoneTextField.getText().trim().isEmpty())
        {
            JOptionPane.showMessageDialog(JOptionPane.getRootFrame(),"Please Enter Employee's Phone Number ","ERROR !",JOptionPane.ERROR_MESSAGE);
            return;
        }

        while(y<x)
        {
            try
            {
                if(!Character.isDigit(ch[y]))
                {
                JOptionPane.showMessageDialog(JOptionPane.getRootFrame(),"Employee's Phone Number Must Be in Digits","ERROR !",JOptionPane.ERROR_MESSAGE);
                return;
                }
            }
            catch(Exception e)
            {
                JOptionPane.showMessageDialog(JOptionPane.getRootFrame(),"Phone Number Can Not Contain Alphabets","ERROR !",JOptionPane.ERROR_MESSAGE);
                jPhoneTextField.setText("");
                System.out.println(e+" Non int available in "+value+" non int is "+ch[y]);
                return;
            }
        y++;
        }

        if(jDepartmentComboBox.getSelectedItem().equals("-- Select --"))
        {
            JOptionPane.showMessageDialog(JOptionPane.getRootFrame(),"Please Select Employee's Department ","ERROR !",JOptionPane.ERROR_MESSAGE);
            return;
        }
        if(jDesignationComboBox.getSelectedItem().equals("-- Select --"))
        {
            JOptionPane.showMessageDialog(JOptionPane.getRootFrame(),"Please Select Employee's Designation ","ERROR !",JOptionPane.ERROR_MESSAGE);
            return;
        }
        if(jZipTextField.getText().trim().isEmpty())
        {
            JOptionPane.showMessageDialog(JOptionPane.getRootFrame(),"Please Enter Employee's Zip Code ","ERROR !",JOptionPane.ERROR_MESSAGE);
            return;
        }
        if(jCityTextField.getText().trim().isEmpty())
        {
            JOptionPane.showMessageDialog(JOptionPane.getRootFrame(),"Please Enter Employee's City ","ERROR !",JOptionPane.ERROR_MESSAGE);
            return;
        }
        if(jCountryComboBox.getSelectedItem().equals("-- Select --"))
        {
            JOptionPane.showMessageDialog(JOptionPane.getRootFrame(),"Please Select Employee's Country ","ERROR !",JOptionPane.ERROR_MESSAGE);
            return;
        }
        if(jSexComboBox.getSelectedItem().equals("-- Select --"))
        {
            JOptionPane.showMessageDialog(JOptionPane.getRootFrame(),"Please Select Employee's Sex ","ERROR !",JOptionPane.ERROR_MESSAGE);
            return;
        }        
        
        if(!jAccountNoTextField.getText().trim().isEmpty())
        {
            while(yy<xx)
            {
                try
                {
                    if(!Character.isDigit(ch2[yy]))
                    {
                    JOptionPane.showMessageDialog(JOptionPane.getRootFrame(),"Employee's Account Number Must Be in Digits","ERROR !",JOptionPane.ERROR_MESSAGE);
                    return;
                    }
                }
                catch(Exception e)
                {
                    JOptionPane.showMessageDialog(JOptionPane.getRootFrame(),"Account Number Can Not Contain Alphabets","ERROR !",JOptionPane.ERROR_MESSAGE);
                    jAccountNoTextField.setText("");
                    System.out.println(e+" Non int available in "+value2+" non int is "+ch2[yy]);
                    return;
                }

                yy++;
            }

        }
        if(!dbResignationDay.equalsIgnoreCase("-- Day --"))
        {
            JOptionPane.showMessageDialog(JOptionPane.getRootFrame(),"Sorry, can't edit a resigned employee !","ERROR !",JOptionPane.ERROR_MESSAGE);
            return;

        }
        if(jResignationCheckBox.isSelected())
        {
                if(resignationMonthComboBox.getSelectedItem().equals("-- Month --"))
                {
                    JOptionPane.showMessageDialog(JOptionPane.getRootFrame(),"Please Select Employee's Resignation Month ","ERROR !",JOptionPane.ERROR_MESSAGE);
                    return;
                }
                if(resignationDayComboBox.getSelectedItem().equals("-- Day --"))
                {
                    JOptionPane.showMessageDialog(JOptionPane.getRootFrame(),"Please Select Employee's Resignation Day ","ERROR !",JOptionPane.ERROR_MESSAGE);
                    return;
                }
                if(resignationYearComboBox.getSelectedItem().equals("-- Year --"))
                {
                    JOptionPane.showMessageDialog(JOptionPane.getRootFrame(),"Please Select Employee's Resigantion Year ","ERROR !",JOptionPane.ERROR_MESSAGE);
                    return;
                }
        }
        
        if(jPictureCheckBox.isSelected()){
                if(filePath.isEmpty())
                {
                            JOptionPane.showMessageDialog(JOptionPane.getRootFrame(),"Please Browse Employee's Picture ","ERROR !",JOptionPane.ERROR_MESSAGE);
                            return;
                }
                systems.deleteEmployeeImage(jEmployeeIDComboBox.getSelectedItem().toString());
                savePicture();
        }
        else{
        /* Execute submit thread */
        editEmployeeThread=new Thread(new Runnable() {
            public void run() {
                disableControls();
                submitData();
                resetCheckBoxes();
                resetFields();
            }
        });
        editEmployeeTitleThread=new Thread(new Runnable() {
            public void run() {
                while(editEmployeeThread.isAlive())setProcessingTitle(editEmployeeTitleThread);
                enableControls();
                System.out.println("accountThread stopped runing.");
            }
        });
        editEmployeeThread.start();
        editEmployeeTitleThread.start();
        }
    }//GEN-LAST:event_jUpdateButtonActionPerformed
    
    private void setProcessingTitle(Thread thread)
    {
        try{
            this.setTitle("::. Edit Employee - Processing Request");
            thread.sleep(500);
            this.setTitle("::. Edit Employee - Processing Request.");
            thread.sleep(500);
            this.setTitle("::. Edit Employee - Processing Request..");
            thread.sleep(500);
            this.setTitle("::. Edit Employee - Processing Request...");
            thread.sleep(500);
        }catch(Exception e){System.out.println("Title thread"+e);}
    }
    private void cancelButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelButtonActionPerformed
        
        if(editEmployeeThread.isAlive())
        {
            try{
                editEmployeeThread.stop();
                editEmployeeTitleThread.stop();
                System.out.println("Threads successfully stopped.");
            }catch(Exception e){System.out.println("Thread stopping error: "+e);}
            this.setTitle("::. Edit Employee");
            enableControls();
        }
        else
            this.dispose();
    }//GEN-LAST:event_cancelButtonActionPerformed

    private void jFirstNameTextFieldKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jFirstNameTextFieldKeyTyped
        // TODO add your handling code here:

        String value=jFirstNameTextField.getText();
        if(value.length()>19)
        {
        JOptionPane.showMessageDialog(JOptionPane.getRootFrame(),"Maximum Number of Character (20) Exceeded ","ERROR !",JOptionPane.ERROR_MESSAGE);
        String newValue=String.copyValueOf(value.toCharArray(),0, 19);
        jFirstNameTextField.setText(newValue);
        }
    }//GEN-LAST:event_jFirstNameTextFieldKeyTyped

    private void jMiddleNameTextFieldKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jMiddleNameTextFieldKeyTyped
        // TODO add your handling code here:

        String value=jMiddleNameTextField.getText();
        if(value.length()>19)
        {
        JOptionPane.showMessageDialog(JOptionPane.getRootFrame(),"Maximum Number of Character (20) Exceeded ","ERROR !",JOptionPane.ERROR_MESSAGE);
        String newValue=String.copyValueOf(value.toCharArray(),0, 19);
        jMiddleNameTextField.setText(newValue);
        }
    }//GEN-LAST:event_jMiddleNameTextFieldKeyTyped

    private void jLastNameTextFieldKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jLastNameTextFieldKeyTyped
        // TODO add your handling code here:
        String value=jLastNameTextField.getText();
        if(value.length()>19)
        {
        JOptionPane.showMessageDialog(JOptionPane.getRootFrame(),"Maximum Number of Character (20) Exceeded ","ERROR !",JOptionPane.ERROR_MESSAGE);
        String newValue=String.copyValueOf(value.toCharArray(),0, 19);
        jLastNameTextField.setText(newValue);
        }

    }//GEN-LAST:event_jLastNameTextFieldKeyTyped

    private void jAddressTextFieldKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jAddressTextFieldKeyTyped
        // TODO add your handling code here:
        String value=jAddressTextField.getText();
        if(value.length()>79)
        {
        JOptionPane.showMessageDialog(JOptionPane.getRootFrame(),"Maximum Number of Character (80) Exceeded ","ERROR !",JOptionPane.ERROR_MESSAGE);
        String newValue=String.copyValueOf(value.toCharArray(),0, 39);
        jAddressTextField.setText(newValue);
        }

    }//GEN-LAST:event_jAddressTextFieldKeyTyped

    private void jStateTextFieldKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jStateTextFieldKeyTyped
        // TODO add your handling code here:

        String value=jStateTextField.getText();
        if(value.length()>14)
        {
        JOptionPane.showMessageDialog(JOptionPane.getRootFrame(),"Maximum Number of Character (15) Exceeded ","ERROR !",JOptionPane.ERROR_MESSAGE);
        String newValue=String.copyValueOf(value.toCharArray(),0, 14);
        jStateTextField.setText(newValue);
        }
    }//GEN-LAST:event_jStateTextFieldKeyTyped

    private void jPhoneTextFieldKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jPhoneTextFieldKeyTyped
        // TODO add your handling code here:

        String value=jPhoneTextField.getText();
        if(value.length()>14)
        {
        JOptionPane.showMessageDialog(JOptionPane.getRootFrame(),"Maximum Number of Character (15) Exceeded ","ERROR !",JOptionPane.ERROR_MESSAGE);
        String newValue=String.copyValueOf(value.toCharArray(),0, 14);
        jPhoneTextField.setText(newValue);
        }
    }//GEN-LAST:event_jPhoneTextFieldKeyTyped

    private void jZipTextFieldKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jZipTextFieldKeyTyped
        // TODO add your handling code here:

        String value=jZipTextField.getText();
        if(value.length()>7)
        {
        JOptionPane.showMessageDialog(JOptionPane.getRootFrame(),"Maximum Number of Character (8) Exceeded ","ERROR !",JOptionPane.ERROR_MESSAGE);
        String newValue=String.copyValueOf(value.toCharArray(),0,7);
        jZipTextField.setText(newValue);
        }
    }//GEN-LAST:event_jZipTextFieldKeyTyped

    private void jCityTextFieldKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jCityTextFieldKeyTyped
        // TODO add your handling code here:

        String value=jCityTextField.getText();
        if(value.length()>14)
        {
        JOptionPane.showMessageDialog(JOptionPane.getRootFrame(),"Maximum Number of Character (15) Exceeded ","ERROR !",JOptionPane.ERROR_MESSAGE);
        String newValue=String.copyValueOf(value.toCharArray(),0, 14);
        jCityTextField.setText(newValue);
        }
    }//GEN-LAST:event_jCityTextFieldKeyTyped

    private void jAccountNoTextFieldKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jAccountNoTextFieldKeyTyped
        // TODO add your handling code here:

        String value=jAccountNoTextField.getText();
        if(value.length()>39)
        {
        JOptionPane.showMessageDialog(JOptionPane.getRootFrame(),"Maximum Number of Character (40) Exceeded ","ERROR !",JOptionPane.ERROR_MESSAGE);
        String newValue=String.copyValueOf(value.toCharArray(),0, 39);
        jAccountNoTextField.setText(newValue);
        }
    }//GEN-LAST:event_jAccountNoTextFieldKeyTyped

    private void jDepartmentComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jDepartmentComboBoxActionPerformed
        // TODO add your handling code here:
        String department=jDepartmentComboBox.getSelectedItem().toString();
        if(department.equals("-- Select --"))
        {
            resetDepartment();
        }
    }//GEN-LAST:event_jDepartmentComboBoxActionPerformed

    private void jDesignationComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jDesignationComboBoxActionPerformed
        // TODO add your handling code here:
        String designation=jDesignationComboBox.getSelectedItem().toString();
        if(designation.equals("-- Select --"))
        {
            resetDesignation();
        }
    }//GEN-LAST:event_jDesignationComboBoxActionPerformed

    private void jBankComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBankComboBoxActionPerformed
        // TODO add your handling code here:
        String bank=jBankComboBox.getSelectedItem().toString();
        if(bank.equals("-- Select --"))
        {
            resetBank();
        }
    }//GEN-LAST:event_jBankComboBoxActionPerformed

    private void resignationMonthComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_resignationMonthComboBoxActionPerformed
        // TODO add your handling code here:
        String aptMonth=resignationMonthComboBox.getSelectedItem().toString();

        if(aptMonth.equals("-- Month --"))
        {
        }
        else
        {
            resetRsgDay(aptMonth);
        }
    }//GEN-LAST:event_resignationMonthComboBoxActionPerformed

     void savePicture()
    {
        String employeeID=jEmployeeIDComboBox.getSelectedItem().toString();
        File fileIn=new File(filePath);
        File fileOut=new File(Configuration.employeeImageDirPath+employeeID.trim()+".jpg");
        if(fileOut.exists())
        {
            fileOut.delete();
        }    
        if(fileIn.renameTo(fileOut)==false)
        {
            String[] pictureFormat;
            try{
                pictureFormat=ImageIO.getReaderFormatNames();
                String formats="";
                int i=pictureFormat.length;
                for(int control=0;control<i;control++)
                {formats=formats+","+pictureFormat[control];}
                System.out.println(formats);
                System.out.println(fileOut.getAbsolutePath());
                System.out.println("FIN: "+fileIn.getAbsolutePath());
                //ImageReader im=ImageIO.getImageReader(null);
                RenderedImage imageBuffered=ImageIO.read(fileIn);
                ImageIO.write(imageBuffered,"JPG", fileOut);
                fileOut=null;
                fileIn=null;

                JOptionPane.showMessageDialog(JOptionPane.getRootFrame(),"Picture Successfully Saved !","Execution SUCCESSFUL !",JOptionPane.INFORMATION_MESSAGE);
            }
            catch(Exception e)
            {
                System.out.println("EditEmployee.savePicture() gave error! "+e);
            }
        }
        else
        {
                JOptionPane.showMessageDialog(JOptionPane.getRootFrame(),"Picture Successfully Saved !!","Execution SUCCESSFUL !",JOptionPane.INFORMATION_MESSAGE);

        }

    }

    private void jPictureButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jPictureButtonActionPerformed
        
      try{
                chooseFile=new JFileChooser();
                chooseFile.showOpenDialog(this);
                pictureFile=chooseFile.getSelectedFile();
                filePath=pictureFile.getAbsolutePath();
                pictureIcon=new ImageIcon(filePath);
                pictureInput=new FileInputStream(filePath);
                System.out.println(filePath);                
                pictureImage=ImageIO.read(pictureInput);
                int iconHeight=pictureIcon.getIconHeight();
                int iconWidth=pictureIcon.getIconWidth();
                if(140>=iconHeight || 160>=iconWidth)
                {
                picLabel.setIcon(pictureIcon);
                }
                else
                {
                    JOptionPane.showMessageDialog(JOptionPane.getRootFrame(),"Picture size is more than : \n        "+140+" * "+160,"Allocation ERROR !",JOptionPane.ERROR_MESSAGE);
                }
    }
   catch(Exception e){ System.out.println("EditEmployee.browseButton gave error! ");}

    }//GEN-LAST:event_jPictureButtonActionPerformed

    private void jPictureCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jPictureCheckBoxActionPerformed
        // TODO add your handling code here:
        if(jPictureCheckBox.isSelected())
        {
            jPictureButton.setEnabled(true);
        }
        else
        {
            jPictureButton.setEnabled(false);

        }
    }//GEN-LAST:event_jPictureCheckBoxActionPerformed

    private void jEmployeeIDComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jEmployeeIDComboBoxActionPerformed
        
        /* Execute submit thread */
        editEmployeeThread=new Thread(new Runnable() {
            public void run() {
                disableControls();
                employeeIDSelected();
            }
        });
        editEmployeeTitleThread=new Thread(new Runnable() {
            public void run() {
                while(editEmployeeThread.isAlive())setProcessingTitle(editEmployeeTitleThread);
                enableControls();
                System.out.println("accountThread stopped runing.");
            }
        });
        editEmployeeThread.start();
        editEmployeeTitleThread.start();

    }//GEN-LAST:event_jEmployeeIDComboBoxActionPerformed
    private void employeeIDSelected()
    {
        String employeeID=jEmployeeIDComboBox.getSelectedItem().toString();
        if(employeeID.equals("-- Select --"))
        {
            resetFields();
        }
        else
        {
                dbFirstName=systems.getValue(OpenMSApp.Database_A,"Select * from employee where cEmployeeID= '"+employeeID+"'", "vFirstName").trim();
               
                dbMiddleName=systems.getValue(OpenMSApp.Database_A,"Select * from employee where cEmployeeID= '"+employeeID+"'", "vMiddleName").trim();
                dbLastName=systems.getValue(OpenMSApp.Database_A,"Select * from employee where cEmployeeID= '"+employeeID+"'", "vLastName").trim();
                dbTitle=systems.getValue(OpenMSApp.Database_A,"Select * from employee where cEmployeeID= '"+employeeID+"'", "cTitle").trim();
                dbStatus=systems.getValue(OpenMSApp.Database_A,"Select * from employee where cEmployeeID= '"+employeeID+"'", "cStatus").trim();
                dbAddress=systems.getValue(OpenMSApp.Database_A,"Select * from employee where cEmployeeID= '"+employeeID+"'", "vAddress").trim();
                dbCity=systems.getValue(OpenMSApp.Database_A,"Select * from employee where cEmployeeID= '"+employeeID+"'", "cCity").trim();;
                dbState=systems.getValue(OpenMSApp.Database_A,"Select * from employee where cEmployeeID= '"+employeeID+"'", "cState").trim();
                dbCountryCode=systems.getValue(OpenMSApp.Database_A,"Select * from employee where cEmployeeID= '"+employeeID+"'", "cCountryCode").trim();
                dbZip=systems.getValue(OpenMSApp.Database_A,"Select * from employee where cEmployeeID= '"+employeeID+"'", "cZip").trim();
                dbSex=systems.getValue(OpenMSApp.Database_A,"Select * from employee where cEmployeeID= '"+employeeID+"'", "cSex").trim();
                dbDOB=systems.getDateValue(OpenMSApp.Database_A,"Select * from employee where cEmployeeID= '"+employeeID+"'", "dDateOfBirth");

            dbDOBMonth=systems.getDateMonth(dbDOB);
            dbDOBDay=systems.getDateDay(dbDOB);
            dbDOBYear=systems.getDateYear(dbDOB);

                dbPhoneNo=systems.getValue(OpenMSApp.Database_A,"Select * from employee where cEmployeeID= '"+employeeID+"'", "cPhone").trim();
                dbDepartmentCode=systems.getValue(OpenMSApp.Database_A,"Select * from employee where cEmployeeID= '"+employeeID+"'", "cDepartmentCode").trim();
                dbDesignationCode=systems.getValue(OpenMSApp.Database_A,"Select * from employee where cEmployeeID= '"+employeeID+"'", "cDesignationCode").trim();
                dbBankCode=systems.getValue(OpenMSApp.Database_A,"Select * from employee where cEmployeeID= '"+employeeID+"'", "cBankCode").trim();
                dbAccountNo=systems.getValue(OpenMSApp.Database_A,"Select * from employee where cEmployeeID= '"+employeeID+"'", "vAccountNumber").trim();

                dbAppointmentDate=systems.getDateValue(OpenMSApp.Database_A,"Select * from employee where cEmployeeID= '"+employeeID+"'", "dAppointmentDate");

            dbAptMonth=systems.getDateMonth(dbAppointmentDate);
            dbAptDay=systems.getDateDay(dbAppointmentDate);
            dbAptYear=systems.getDateYear(dbAppointmentDate);

                dbResignationDate=systems.getDateValue(OpenMSApp.Database_A,"Select * from employee where cEmployeeID= '"+employeeID+"'", "dResignationDate");

            dbResignationMonth=systems.getDateMonth(dbResignationDate);
            dbResignationDay=systems.getDateDay(dbResignationDate);
            dbResignationYear=systems.getDateYear(dbResignationDate);

            

            dbCountry=systems.getValue(OpenMSApp.Database_A,"Select * from country where cCountryCode= '"+dbCountryCode+"'","vCountryName");
            dbDepartment=systems.getValue(OpenMSApp.Database_A,"Select * from department where cDepartmentCode= '"+dbDepartmentCode+"'","vDepartmentName");
            dbDesignation=systems.getValue(OpenMSApp.Database_A,"Select * from designation where cDesignationCode= '"+dbDesignationCode+"'","vDesignationName");
            dbBank=systems.getValue(OpenMSApp.Database_A,"Select * from Bank where cBankCode= '"+dbBankCode+"'","vName");

            jFirstNameTextField.setText(dbFirstName);
            jLastNameTextField.setText(dbLastName);
            jMiddleNameTextField.setText(dbMiddleName);
            jTitleComboBox.setSelectedItem(dbTitle);
            jStatusComboBox.setSelectedItem(dbStatus);
            jAddressTextField.setText(dbAddress);
            jCityTextField.setText(dbCity);
            jStateTextField.setText(dbState);
            jCountryComboBox.setSelectedItem(dbCountry);
            jZipTextField.setText(dbZip);
            jSexComboBox.setSelectedItem(dbSex);
            jPhoneTextField.setText(dbPhoneNo);

            jDepartmentComboBox.setSelectedItem(dbDepartment);
            jDesignationComboBox.setSelectedItem(dbDesignation);
            jBankComboBox.setSelectedItem(getDbBank(dbBank));
            jAccountNoTextField.setText(dbAccountNo);

            dobMonthComboBox.setSelectedItem(dbDOBMonth);
            dobDayComboBox.setSelectedItem(dbDOBDay);
            dobYearComboBox.setSelectedItem(dbDOBYear);

            aptMonthComboBox.setSelectedItem(dbAptMonth);
            aptDayComboBox.setSelectedItem(dbAptDay);
            aptYearComboBox.setSelectedItem(dbAptYear);

            resignationMonthComboBox.setSelectedItem(dbResignationMonth);
            resignationDayComboBox.setSelectedItem(dbResignationDay);
            resignationYearComboBox.setSelectedItem(dbResignationYear);


            picLabel.setIcon(systems.getEmployeeImage(employeeID));
        }
            resetCheckBoxes();
            disableFields();
    }
    void emptyDBfields()
    {
     dbFirstName="";
     dbMiddleName="";
     dbLastName="";
     dbTitle="";
     dbStatus="";
     dbAddress="";
     dbState="";
     dbCity="";
     dbCountryCode="";
     dbCountry="";
     dbPhoneNo="";
     dbDepartmentCode="";
     dbDepartment="";
     dbDesignationCode="";
     dbDesignation="";
     dbZip="";
     dbSex="";
     dbAccountNo="";
     dbBank="";
     dbBankCode="";
     dbAptDay="-- Day --";
     dbAptMonth="-- Month --";
     dbAptYear="-- Year --";
     dbDOBDay="-- Day --";
     dbDOBMonth="-- Month --";
     dbDOBYear="-- Year --";

     dbResignationDay="-- Day --";
     dbResignationMonth="-- Month --";
     dbResignationYear="-- Year --";

    }
    private void dobMonthComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_dobMonthComboBoxActionPerformed
        // TODO add your handling code here:
        String dobMonth=dobMonthComboBox.getSelectedItem().toString();

        if(dobMonth.equals("-- Month --"))
        {
        }
        else
        {
            resetDobDay(dobMonth);
        }

    }//GEN-LAST:event_dobMonthComboBoxActionPerformed

    private void aptMonthComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_aptMonthComboBoxActionPerformed
        // TODO add your handling code here:
        String aptMonth=aptMonthComboBox.getSelectedItem().toString();

        if(aptMonth.equals("-- Month --"))
        {
        }
        else
        {
            resetAptDay(aptMonth);
        }

    }//GEN-LAST:event_aptMonthComboBoxActionPerformed

    private void jStatusCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jStatusCheckBoxActionPerformed
        // TODO add your handling code here:
        if(jStatusCheckBox.isSelected())
        {
            jStatusComboBox.setEnabled(true);
        }
        else
        {
            jStatusComboBox.setEnabled(false);
            if(dbStatus.isEmpty()){
            jStatusComboBox.setSelectedItem("-- Select --"); }
            else{
            jStatusComboBox.setSelectedItem(dbStatus);
            }
        }
    }//GEN-LAST:event_jStatusCheckBoxActionPerformed

    /*public Icon getImage()
    {
        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(milliscriptdms.OpenMSApp.class).getContext().getResourceMap(EditEmployee.class);
        Icon displayedImage=resourceMap.getIcon("picLabel.icon");
        Icon empImage=null;
        empImage=new ImageIcon(OpenMSApp.employeeImageDirPath+jEmployeeIDComboBox.getSelectedItem().toString().trim()+".jpg");
        if(empImage.getIconHeight()!=-1)
        {
            displayedImage=empImage;
        }

        System.out.println("Icon Height is "+empImage.toString()+" "+empImage.getIconHeight()+" empImage= "+jEmployeeIDComboBox.getSelectedItem().toString().trim()+".jpg");
        return displayedImage;
    }*/
     void resetEmployeeID()
    {
        String[] employeeID=systems.getTableDataArray(OpenMSApp.Database_A,"Employee",1);
        employeeID[0]="-- Select --";

        jEmployeeIDComboBox.setModel(new DefaultComboBoxModel(employeeID));
    }
     void resetCountry()
    {
        String[] country=systems.getTableDataArray(OpenMSApp.Database_A,"Country",2);
        country[0]="-- Select --";

        jCountryComboBox.setModel(new DefaultComboBoxModel(country));
        jCountryComboBox.setSelectedItem("NIGERIA");
    }
     boolean isCheckBoxesFalse()
    {
        boolean state = true;
        if((!jTitleCheckBox.isSelected())&&(!jStatusCheckBox.isSelected())&&(!jLastNameCheckBox.isSelected())&&(!jAddressCheckBox.isSelected())&&(!jStateCheckBox.isSelected())&&(!jDepartmentCheckBox.isSelected())
                &&(!jDesignationCheckBox.isSelected())&&(!jResignationCheckBox.isSelected())&&(!jPhoneCheckBox.isSelected())
                &&(!jZipCheckBox.isSelected())&&(!jCityCheckBox.isSelected())&&(!jCountryCheckBox.isSelected())&&(!jAccountCheckBox.isSelected())
                &&(!jBankCheckBox.isSelected())&&(!jPictureCheckBox.isSelected()))
        {
        state=false;
        }

        return state;
    }

     void resetDobDay(String dobMonth)
    {
        String[] dobDay={"-- Day --"};
        if(dobMonth.isEmpty())
        {
            dobDayComboBox.setModel(new DefaultComboBoxModel(dobDay));
        }
        else
        {
            dobDay=systems.getDays(dobMonth);
            dobDay[0]="-- Day --";
            dobDayComboBox.setModel(new DefaultComboBoxModel(dobDay));
        }
    }
     void resetDobMonth()
    {
        String[] month=systems.getMonthArray();
        month[0]="-- Month --";
        dobMonthComboBox.setModel(new DefaultComboBoxModel(month));
    }

     void resetDobYear()
    {
        String[] year=systems.getYears(1980);
        year[0]="-- Year --";
        dobYearComboBox.setModel(new DefaultComboBoxModel(year));
    }

     void resetDepartment()
    {
        String[] department=systems.getTableDataArray(OpenMSApp.Database_A,"Department",2);
        department[0]="-- Select --";

        jDepartmentComboBox.setModel(new DefaultComboBoxModel(department));
    }
     void resetDesignation()
    {
        String[] designation=systems.getTableDataArray(OpenMSApp.Database_A,"Designation",2);
        designation[0]="-- Select --";

        jDesignationComboBox.setModel(new DefaultComboBoxModel(designation));
    }
     void resetAptDay(String aptMonth)
    {
        String[] aptDay={"-- Day --"};
        if(aptMonth.isEmpty())
        {
            aptDayComboBox.setModel(new DefaultComboBoxModel(aptDay));
        }
        else
        {
            aptDay=systems.getDays(aptMonth);
            aptDay[0]="-- Day --";
            aptDayComboBox.setModel(new DefaultComboBoxModel(aptDay));
        }
    }
     void resetAptMonth()
    {
        String[] month=systems.getMonthArray();
        month[0]="-- Month --";
        aptMonthComboBox.setModel(new DefaultComboBoxModel(month));
    }

     void resetAptYear()
    {
        String[] year=systems.getYears(1920);
        year[0]="-- Year --";
        aptYearComboBox.setModel(new DefaultComboBoxModel(year));
    }
     void resetBank()
    {
        String[] bank=systems.getTableDataArray(OpenMSApp.Database_A,"bank",2);
        bank[0]="-- Select --";

        jBankComboBox.setModel(new DefaultComboBoxModel(bank));
    }
     void resetRsgDay(String rsgMonth)
    {
        String[] rsgDay={"-- Day --"};
        if(rsgMonth.isEmpty())
        {
            resignationDayComboBox.setModel(new DefaultComboBoxModel(rsgDay));
        }
        else
        {
            rsgDay=systems.getDays(rsgMonth);
            rsgDay[0]="-- Day --";
            resignationDayComboBox.setModel(new DefaultComboBoxModel(rsgDay));
        }
    }
     void resetRsgMonth()
    {
        String[] month=systems.getMonthArray();
        month[0]="-- Month --";
        resignationMonthComboBox.setModel(new DefaultComboBoxModel(month));
    }

     void resetRsgYear()
    {
        String[] year=systems.getYears(1920);
        year[0]="-- Year --";
        resignationYearComboBox.setModel(new DefaultComboBoxModel(year));
    }
     void reset()
    {
        resetFields();
        resetCheckBoxes();
        disableFields();
    }
     void resetCheckBoxes()
    {
        jTitleCheckBox.setSelected(false);
        jStatusCheckBox.setSelected(false);
        jLastNameCheckBox.setSelected(false);
        jAddressCheckBox.setSelected(false);
        jStateCheckBox.setSelected(false);
        jDepartmentCheckBox.setSelected(false);
        jPhoneCheckBox.setSelected(false);
        jDesignationCheckBox.setSelected(false);
        jResignationCheckBox.setSelected(false);
        jZipCheckBox.setSelected(false);
        jCityCheckBox.setSelected(false);
        jCountryCheckBox.setSelected(false);
        jAccountCheckBox.setSelected(false);
        jBankCheckBox.setSelected(false);
        jPictureCheckBox.setSelected(false);
    }
     void disableFields()
    {
            jAddressTextField.setEnabled(false);
            jAddressTextField.setEditable(false);

            jFirstNameTextField.setEnabled(false);
            jFirstNameTextField.setEditable(false);

            jMiddleNameTextField.setEnabled(false);
            jMiddleNameTextField.setEditable(false);

            jLastNameTextField.setEnabled(false);
            jLastNameTextField.setEditable(false);

            jCityTextField.setEnabled(false);
            jCityTextField.setEditable(false);

            jStateTextField.setEnabled(false);
            jStateTextField.setEditable(false);

            jZipTextField.setEnabled(false);
            jZipTextField.setEditable(false);

            jPhoneTextField.setEnabled(false);
            jPhoneTextField.setEditable(false);

            jAccountNoTextField.setEnabled(false);
            jAccountNoTextField.setEditable(false);

            jCountryComboBox.setEnabled(false);
            jCountryComboBox.setEditable(false);

            jDepartmentComboBox.setEnabled(false);
            jDepartmentComboBox.setEditable(false);

            jDesignationComboBox.setEnabled(false);
            jDesignationComboBox.setEditable(false);

            jBankComboBox.setEnabled(false);
            jBankComboBox.setEditable(false);

            resignationDayComboBox.setEnabled(false);
            resignationDayComboBox.setEditable(false);

            resignationMonthComboBox.setEnabled(false);
            resignationMonthComboBox.setEditable(false);

            resignationYearComboBox.setEnabled(false);
            resignationYearComboBox.setEditable(false);

            aptYearComboBox.setEnabled(false);
            aptYearComboBox.setEditable(false);

            aptMonthComboBox.setEnabled(false);
            aptMonthComboBox.setEditable(false);

            aptDayComboBox.setEnabled(false);
            aptDayComboBox.setEditable(false);

            jTitleComboBox.setEnabled(false);
            jTitleComboBox.setEditable(false);

            jStatusComboBox.setEnabled(false);
            jStatusComboBox.setEditable(false);

            dobYearComboBox.setEnabled(false);
            dobYearComboBox.setEditable(false);

            dobMonthComboBox.setEnabled(false);
            dobMonthComboBox.setEditable(false);

            dobDayComboBox.setEnabled(false);
            dobDayComboBox.setEditable(false);

            jSexComboBox.setEnabled(false);
            jSexComboBox.setEditable(false);

            jPictureButton.setEnabled(false);
            
    }
    private void disableControls()
    {
            jAddressTextField.setEnabled(false);
            jAddressTextField.setEditable(false);

            jFirstNameTextField.setEnabled(false);
            jFirstNameTextField.setEditable(false);

            jMiddleNameTextField.setEnabled(false);
            jMiddleNameTextField.setEditable(false);

            jLastNameTextField.setEnabled(false);
            jLastNameTextField.setEditable(false);

            jCityTextField.setEnabled(false);
            jCityTextField.setEditable(false);

            jStateTextField.setEnabled(false);
            jStateTextField.setEditable(false);

            jZipTextField.setEnabled(false);
            jZipTextField.setEditable(false);

            jPhoneTextField.setEnabled(false);
            jPhoneTextField.setEditable(false);

            jAccountNoTextField.setEnabled(false);
            jAccountNoTextField.setEditable(false);

            jCountryComboBox.setEnabled(false);
            jCountryComboBox.setEditable(false);

            jDepartmentComboBox.setEnabled(false);
            jDepartmentComboBox.setEditable(false);

            jDesignationComboBox.setEnabled(false);
            jDesignationComboBox.setEditable(false);

            jBankComboBox.setEnabled(false);
            jBankComboBox.setEditable(false);

            resignationDayComboBox.setEnabled(false);
            resignationDayComboBox.setEditable(false);

            resignationMonthComboBox.setEnabled(false);
            resignationMonthComboBox.setEditable(false);

            resignationYearComboBox.setEnabled(false);
            resignationYearComboBox.setEditable(false);
            
            aptYearComboBox.setEnabled(false);
            aptYearComboBox.setEditable(false);

            aptMonthComboBox.setEnabled(false);
            aptMonthComboBox.setEditable(false);

            aptDayComboBox.setEnabled(false);
            aptDayComboBox.setEditable(false);

            jTitleComboBox.setEnabled(false);
            jTitleComboBox.setEditable(false);

            jStatusComboBox.setEnabled(false);
            jStatusComboBox.setEditable(false);

            dobYearComboBox.setEnabled(false);
            dobYearComboBox.setEditable(false);

            dobMonthComboBox.setEnabled(false);
            dobMonthComboBox.setEditable(false);

            dobDayComboBox.setEnabled(false);
            dobDayComboBox.setEditable(false);

            jSexComboBox.setEnabled(false);
            jSexComboBox.setEditable(false);

            jPictureButton.setEnabled(false);
            jUpdateButton.setEnabled(false);
            jEmployeeIDComboBox.setEnabled(false);
            
        jTitleCheckBox.setEnabled(false);
        jStatusCheckBox.setEnabled(false);
        jLastNameCheckBox.setEnabled(false);
        jAddressCheckBox.setEnabled(false);
        jStateCheckBox.setEnabled(false);
        jDepartmentCheckBox.setEnabled(false);
        jPhoneCheckBox.setEnabled(false);
        jDesignationCheckBox.setEnabled(false);
        jResignationCheckBox.setEnabled(false);
        jZipCheckBox.setEnabled(false);
        jCityCheckBox.setEnabled(false);
        jCountryCheckBox.setEnabled(false);
        jAccountCheckBox.setEnabled(false);
        jBankCheckBox.setEnabled(false);
        jPictureCheckBox.setEnabled(false);
    }
    private void enableControls()
    {
        jTitleCheckBox.setEnabled(true);
        jStatusCheckBox.setEnabled(true);
        jLastNameCheckBox.setEnabled(true);
        jAddressCheckBox.setEnabled(true);
        jStateCheckBox.setEnabled(true);
        jDepartmentCheckBox.setEnabled(true);
        jPhoneCheckBox.setEnabled(true);
        jDesignationCheckBox.setEnabled(true);
        jResignationCheckBox.setEnabled(true);
        jZipCheckBox.setEnabled(true);
        jCityCheckBox.setEnabled(true);
        jCountryCheckBox.setEnabled(true);
        jAccountCheckBox.setEnabled(true);
        jBankCheckBox.setEnabled(true);
        jPictureCheckBox.setEnabled(true);
        
            if(jAddressCheckBox.isSelected())
            {
                jAddressTextField.setEnabled(true);
                jAddressTextField.setEditable(true);
            }

            if(jLastNameCheckBox.isSelected())
            {
                jLastNameTextField.setEnabled(true);
                jLastNameTextField.setEditable(true);
            }

            if(jCityCheckBox.isSelected())
            {
                jCityTextField.setEnabled(true);
                jCityTextField.setEditable(true);
            }

            if(jStateCheckBox.isSelected())
            {
                jStateTextField.setEnabled(true);
                jStateTextField.setEditable(true);
            }

            if(jZipCheckBox.isSelected())
            {
                jZipTextField.setEnabled(true);
                jZipTextField.setEditable(true);
            }

            if(jPhoneCheckBox.isSelected())
            {
                jPhoneTextField.setEnabled(true);
                jPhoneTextField.setEditable(true);
            }

            if(jAccountCheckBox.isSelected())
            {
                jAccountNoTextField.setEnabled(true);
                jAccountNoTextField.setEditable(true);
            }

            if(jCountryCheckBox.isSelected())
            {
                jCountryComboBox.setEnabled(true);
            }

            if(jDepartmentCheckBox.isSelected())
            {
                jDepartmentComboBox.setEnabled(true);
            }

            if(jDesignationCheckBox.isSelected())
            {
                jDesignationComboBox.setEnabled(true);
            }

            if(jBankCheckBox.isSelected())
            {
                jBankComboBox.setEnabled(true);
            }
            if(jTitleCheckBox.isSelected())            
            {
                jTitleComboBox.setEnabled(true);
            }

            if(jStatusCheckBox.isSelected())
            {
                jStatusComboBox.setEnabled(true);
            }

            if(jPictureCheckBox.isSelected())
            {
                jPictureButton.setEnabled(true);
            }

            jUpdateButton.setEnabled(true);
            jEmployeeIDComboBox.setEnabled(true);
            this.setTitle("::. Edit Employee");
            
            if(jResignationCheckBox.isSelected())
            {
                if(dbResignationMonth.isEmpty()==true&&dbResignationDay.isEmpty()==true&&dbResignationYear.isEmpty()==true)
                {
                    JOptionPane.showMessageDialog(JOptionPane.getRootFrame(),"  INVALID OPERATION! \n RESIGNATION DATE AVAILABLE.","ERROR !",JOptionPane.ERROR_MESSAGE);
                    return;
                }
                else
                {
                    resignationMonthComboBox.setEnabled(true);
                    resignationDayComboBox.setEnabled(true);
                    resignationYearComboBox.setEnabled(true);
                }
            }

    }
     void resetFields()
    {
        
        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(openmoneyspinnersuite.OpenMSApp.class).getContext().getResourceMap(EditEmployee.class);
            jAddressTextField.setEnabled(false);
            jAddressTextField.setEditable(false);

            jFirstNameTextField.setEnabled(false);
            jFirstNameTextField.setEditable(false);

            jMiddleNameTextField.setEnabled(false);
            jMiddleNameTextField.setEditable(false);

            jLastNameTextField.setEnabled(false);
            jLastNameTextField.setEditable(false);

            jCityTextField.setEnabled(false);
            jCityTextField.setEditable(false);

            jStateTextField.setEnabled(false);
            jStateTextField.setEditable(false);

            jZipTextField.setEnabled(false);
            jZipTextField.setEditable(false);

            jPhoneTextField.setEnabled(false);
            jPhoneTextField.setEditable(false);

            aptYearComboBox.setEnabled(false);
            aptYearComboBox.setEditable(false);

            aptMonthComboBox.setEnabled(false);
            aptMonthComboBox.setEditable(false);

            aptDayComboBox.setEnabled(false);
            aptDayComboBox.setEditable(false);

            jAccountNoTextField.setEnabled(false);
            jAccountNoTextField.setEditable(false);

            dobYearComboBox.setEnabled(false);
            dobYearComboBox.setEditable(false);

            dobMonthComboBox.setEnabled(false);
            dobMonthComboBox.setEditable(false);

            dobDayComboBox.setEnabled(false);
            dobDayComboBox.setEditable(false);

            jCountryComboBox.setEnabled(false);
            jCountryComboBox.setEditable(false);

            jDepartmentComboBox.setEnabled(false);
            jDepartmentComboBox.setEditable(false);

            jDesignationComboBox.setEnabled(false);
            jDesignationComboBox.setEditable(false);

            jBankComboBox.setEnabled(false);
            jBankComboBox.setEditable(false);

            resignationDayComboBox.setEnabled(false);
            resignationDayComboBox.setEditable(false);

            resignationMonthComboBox.setEnabled(false);
            resignationMonthComboBox.setEditable(false);

            resignationYearComboBox.setEnabled(false);
            resignationYearComboBox.setEditable(false);

            jTitleComboBox.setEnabled(false);
            jTitleComboBox.setEditable(false);

            jStatusComboBox.setEnabled(false);
            jStatusComboBox.setEditable(false);

            jSexComboBox.setEnabled(false);
            jSexComboBox.setEditable(false);
            
            jPictureButton.setEnabled(false);

            jAddressTextField.setText("");
            jFirstNameTextField.setText("");
            jMiddleNameTextField.setText("");
            jLastNameTextField.setText("");
            jCityTextField.setText("");
            jStateTextField.setText("");
            jZipTextField.setText("");
            jPhoneTextField.setText("");
            jAccountNoTextField.setText("");


            jSexComboBox.setSelectedItem("-- Select --");
            jTitleComboBox.setSelectedItem("-- Select --");
            jStatusComboBox.setSelectedItem("-- Select --");
            jBankComboBox.setSelectedItem("-- Select --");
            //picLabel.setIcon(resourceMap.getIcon("picLabel.icon"));
            resetEmployeeID();
            resetCountry();
            resetDepartment();
            resetDesignation();
            resetBank();
            resetRsgDay("");
            resetRsgMonth();
            resetRsgYear();

            resetDobDay("");
            resetDobMonth();
            resetDobYear();

            resetAptDay("");
            resetAptMonth();
            resetAptYear();

            picLabel.setIcon(systems.getEmployeeImage(""));
    }

     String getDbBank(String bankName)
    {
        if(bankName.isEmpty())
        {
            bankName="-- Select --";
        }
        return bankName;
    }
     String getBank()
    {
        String bank=String.valueOf(jBankComboBox.getSelectedItem());

        if(bank.equals("-- Select --"))
        {
            bank="";

        }
        return bank;
    }
     String getResignationDate()
    {
        String resignationDate=null;

        if(jResignationCheckBox.isSelected())
        {           
                resignationDate=new String(String.valueOf(resignationYearComboBox.getSelectedItem()).trim()+"-"+systems.getMonthDigit(String.valueOf(resignationMonthComboBox.getSelectedItem()).trim())+"-"+String.valueOf(resignationDayComboBox.getSelectedItem()).trim());
        }
        if(!dbResignationDay.equals("-- Day --"))
        {
            resignationDate=dbResignationDay+" "+dbResignationMonth+" "+dbResignationYear;
        }
        return resignationDate;
    }
     void submitData()
    {
        //Connect.createMSSQLConnection();
        Connect.changeDB(OpenMSApp.Database_A);
        statement=Connect.createStatement(Connect.procInit+" prnUpdEmployee"+Connect.procInitStart+"?,?,?,?,?,?,?,?,?,?,?,?,?,?,?"+Connect.procInitEnd);
         try
         {
                    statement.setString(1,String.valueOf(jEmployeeIDComboBox.getSelectedItem()).trim());
                    statement.setString(2,jLastNameTextField.getText().trim());
                    statement.setString(3,String.valueOf(jTitleComboBox.getSelectedItem()).trim());
                    statement.setString(4,String.valueOf(jStatusComboBox.getSelectedItem()).trim());
                    statement.setString(5,jAddressTextField.getText().trim());
                    statement.setString(6,jStateTextField.getText().trim());
                    statement.setString(7,jCityTextField.getText().trim());
                    statement.setString(8,jZipTextField.getText().trim());
                    statement.setString(9,String.valueOf(jCountryComboBox.getSelectedItem()).trim());
                    statement.setString(10,jPhoneTextField.getText().trim());
                    statement.setString(11,String.valueOf(jDepartmentComboBox.getSelectedItem()).trim());
                    statement.setString(12,String.valueOf(jDesignationComboBox.getSelectedItem()).trim());
                    statement.setString(13,getBank().trim());
                    statement.setString(14,jAccountNoTextField.getText().trim());
                    statement.setString(15,getResignationDate());
            }
            catch(Exception e)
            {
                System.out.println("EditEmployee.submitData() gave error ! "+e);
            }
        Connect.alert="Y";
        Connect.executeUpdateStatement(statement);
        Connect.closeConnection();
    }


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JComboBox aptDayComboBox;
    private javax.swing.JComboBox aptMonthComboBox;
    private javax.swing.JComboBox aptYearComboBox;
    private javax.swing.JButton cancelButton;
    private javax.swing.JComboBox dobDayComboBox;
    private javax.swing.JComboBox dobMonthComboBox;
    private javax.swing.JComboBox dobYearComboBox;
    private javax.swing.JCheckBox jAccountCheckBox;
    private javax.swing.JTextField jAccountNoTextField;
    private javax.swing.JCheckBox jAddressCheckBox;
    private javax.swing.JTextField jAddressTextField;
    private javax.swing.JCheckBox jBankCheckBox;
    private javax.swing.JComboBox jBankComboBox;
    private javax.swing.JCheckBox jCityCheckBox;
    private javax.swing.JTextField jCityTextField;
    private javax.swing.JCheckBox jCountryCheckBox;
    private javax.swing.JComboBox jCountryComboBox;
    private javax.swing.JCheckBox jDepartmentCheckBox;
    private javax.swing.JComboBox jDepartmentComboBox;
    private javax.swing.JCheckBox jDesignationCheckBox;
    private javax.swing.JComboBox jDesignationComboBox;
    private javax.swing.JComboBox jEmployeeIDComboBox;
    private javax.swing.JPanel jEmployeePanel;
    private javax.swing.JTextField jFirstNameTextField;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JCheckBox jLastNameCheckBox;
    private javax.swing.JTextField jLastNameTextField;
    private javax.swing.JTextField jMiddleNameTextField;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JCheckBox jPhoneCheckBox;
    private javax.swing.JTextField jPhoneTextField;
    private javax.swing.JButton jPictureButton;
    private javax.swing.JCheckBox jPictureCheckBox;
    private javax.swing.JCheckBox jResignationCheckBox;
    private javax.swing.JComboBox jSexComboBox;
    private javax.swing.JCheckBox jStateCheckBox;
    private javax.swing.JTextField jStateTextField;
    private javax.swing.JCheckBox jStatusCheckBox;
    private javax.swing.JComboBox jStatusComboBox;
    private javax.swing.JCheckBox jTitleCheckBox;
    private javax.swing.JComboBox jTitleComboBox;
    private javax.swing.JButton jUpdateButton;
    private javax.swing.JCheckBox jZipCheckBox;
    private javax.swing.JTextField jZipTextField;
    private javax.swing.JLabel picLabel;
    private javax.swing.JComboBox resignationDayComboBox;
    private javax.swing.JComboBox resignationMonthComboBox;
    private javax.swing.JComboBox resignationYearComboBox;
    // End of variables declaration//GEN-END:variables

}
